class EquipmentEditController {
    constructor($rootScope, $scope, $cookieStore, $timeout, $state, ngDialog, dialogService, CpService, getCpList, iRunner){

        var vm = this;

        vm.$rootScope    = $rootScope;
        vm.$cookieStore  = $cookieStore;
        vm.$timeout      = $timeout;
        vm.$state        = $state;
        vm.ngDialog      = ngDialog;
        vm.dialogService = dialogService;
        vm.CpService     = CpService;
        vm.getCpList     = getCpList;
        vm.iRunner       = iRunner;

        // 计时点列表
        vm.getCpList.code==0&&(vm.cplist = vm.getCpList.data);

        // 设备名称
        vm.equipmentName = vm.$state.params.equipmentName;
        // cp点名称
        vm.cpName = vm.$state.params.cpName;

        vm.deleteItems = function(course_id) {
            alert("qwqwqewwe");
            // 返回列表页面
            vm.$state.go("dashboard.race.equipmentlist");
        }
    }

    // 表单提交
    submitForm(isValid) {
        var vm = this;
        // 表单验证不通过的场合
        if(!isValid) {
            vm.ngDialog.open({
                template: '<p>请选择CP点</p>',
                className: 'ngdialog-theme-default ngdialog-alert',
                plain: true
            });
        } else {
            alert("提交表单");
        }
    }

}

EquipmentEditController.$inject = ['$rootScope', '$scope', '$cookieStore', '$timeout', '$state', 'ngDialog', 'dialogService', 'CpService', 'getCpList', 'iRunner']; 

export default EquipmentEditController;